import request from '../../utils/request'
import axios from 'axios'

//获取部门人数
export const findDeptAndCount=()=>{
  return axios({
    url: "/api/department/findDeptAndCount",
    method: 'get',
  })
}

//查询部门
export const getDeptList=(DeptVo)=>{
  return axios({
    url: "/api/department/getDeptList",
    method: 'post',
    data: DeptVo
  })
}

//添加部门
export const addDept=(department)=>{
  return axios({
    url: "/api/department/addDept",
    method: 'post',
    data: department
  })
}

//修改部门
export const updateDept=(department)=>{
  return axios({
    url: "/api/department/updateDept",
    method: 'put',
    data: department
  })
}

//删除部门
export const deleteDept=(id)=>{
  return axios({
    url: "/api/department/deleteDept",
    method: 'delete',
    params:{
      id
    }
  })
}

/*导出部门列表*/
export const downDeptExcel = () => {
  return axios({
    url: '/api/department/excel',
    method: 'post',
    responseType: 'blob'
  })
}


